<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<!--返回错误信息-->
<?php echo validation_errors(); ?>
<!DOCTYPE html>
<html lang="en">

<head>
    <?php
    $title = [
        'title' => '招投标管理',
    ];
    $this->load->view('/admin/common/header', $title);
    ?>
</head>

<body data-type="widgets">
	<script src="/assets/js/theme.js"></script>
	<div class="am-g tpl-g">

	    <!--    头部   侧边菜单-->
	    <?php $this->load->view('/admin/common/bodyLeft'); ?>
    <script type="text/javascript">
    	$(".js-sidebar-nav>li:nth-child(12)>ul").show(80);
    	$(".js-sidebar-nav>li:nth-child(12)>a>span").addClass("sidebar-nav-sub-ico-rotate");
    	$(".js-sidebar-nav>li:nth-child(12)>ul>li:nth-child(2)>a").addClass("active");
    </script>
	    <!-- 内容区域 -->
	    
	</div>
	<div class="tpl-content-wrapper">
        <div class="row-content am-cf">
            <div class="row">
                <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                    <div class="widget am-cf">
                        <div class="widget-head am-cf">
                            <div class="widget-title  am-cf">
                                <ol class="am-breadcrumb am-breadcrumb-slash">
                                    <li><a href="/admin/bidding/index?page=1">招投标管理</a></li>
                                    <li class="am-active"><a href="/admin/bidding/waitingList?page=1">供应商待办</a></li>
                                    <li class="am-active">资质上传</li>
                                </ol>
                            </div>
                        </div>
	                    <div class="widget-body am-fr">
		                    <form action="/admin/bidding/dataUpload" enctype="multipart/form-data" class="am-form" id="form_admin" method="post">
	                        	<div class="tpl-table-black-operation">
	                                <a href="javascript:void(0);" class="tpl-table-black-operation-del">
	                                    报价单上传
	                                </a>
	                            </div>
	                           	<br />
	                    		<div class="am-g-fixed">
	                                <div class="am-form-group am-u-md-12">
	                                	<label for="" class="am-u-sm-2 am-form-label must">上传投标文件：</label>
	                                    <div class="am-inline-block am-form-file" >
										  	<button type="button" class="am-btn am-btn-default am-btn-sm">
										    	<i class="am-icon-cloud-upload"></i> 选择要上传的文件</button>
										  	<input type="file" multiple name="biddingFile" id="biddingFile">
										  	<span class="file-show"></span>
										</div>
	                                </div>
	                                <div class="am-form-group am-u-md-12">
	                                	<label for="" class="am-u-sm-2 am-form-label must">上传报价单：</label>
	                                    <div class="am-inline-block am-form-file">
										  	<button type="button" class="am-btn am-btn-default am-btn-sm">
										    	<i class="am-icon-cloud-upload"></i> 选择要上传的文件</button>
										  	<input type="file" multiple name="bjFile" id="bjFile">
										  	<span class="file-show"></span>
										</div>
	                                </div>
								</div>

	                        	<div class="tpl-table-black-operation am-u-md-12">
	                        		<hr />
	                                <a href="javascript:void(0);" class="tpl-table-black-operation-del">
                                        资料上传
	                                </a>
	                            </div>
								<div class="am-g-fixed">
		                            <div class="am-form-group am-u-md-12">
		                            	<br />
		                            	<label for="" class="am-u-sm-2 am-form-label ">营业执照：</label>
		                                <div class="am-inline-block am-form-file">
										  	<button type="button" class="am-btn am-btn-default am-btn-sm">
										    	<i class="am-icon-cloud-upload"></i> 选择要上传的文件</button>
										  	<input type="file" multiple name="yyzzFile" id="yyzzFile">
										  	<span class="file-show"></span>
										</div>
		                            </div>
		                            <div class="am-form-group am-u-md-12">
		                            	<label for="" class="am-u-sm-2 am-form-label ">其他资质：</label>
		                                <div class="am-inline-block am-form-file">
										  	<button type="button" class="am-btn am-btn-default am-btn-sm">
										    	<i class="am-icon-cloud-upload"></i> 选择要上传的文件</button>
										  	<input type="file" multiple name="otherFile" id="otherFile">
										  	<span class="file-show"></span>
										</div>
		                            </div>
	                            </div>
	                            <div class="tpl-table-black-operation am-u-md-12">
	                        	<hr />
	                                <a href="javascript:void(0);" class="tpl-table-black-operation-del">
	                                    联系信息
	                                </a>
	                            </div>
								<div class="am-g-fixed">

	                            <div class="am-form-group am-u-md-6">
	                            	<br />
								    <label for="contactMan" class="am-u-sm-3 am-form-label must">联系人：</label>
								    <div class="am-u-sm-9">
								      	<input type="text" id="contactMan" name="contactMan">
								    </div>
								</div>
	                            <div class="am-form-group am-u-md-6">
	                            	<br />
								    <label for="phone" class="am-u-sm-3 am-form-label must">联系电话：</label>
								    <div class="am-u-sm-9">
								      	<input type="text" id="phone" name="phone">
								    </div>
								</div>
                                    <input type="hidden" value="<?php echo $_GET['id'] ?>" name="id">
                                    <input type="hidden" value="<?php echo $_GET['biddingId'] ?>" name="biddingId">
	                   			</div>
								<div class="am-u-md-12 btn-box">
									<input type="submit" value="提交" name="action" class="am-btn am-btn-primary tpl-btn-bg-color-success am-u-sm-centered commit" style="width:220px;margin: 20px;">
									<input onclick="back()" value="取消" name="action" class="am-btn am-btn-primary tpl-btn-bg-color-success am-u-sm-centered commit" style="width:220px;margin: 20px;">
								</div>
	                    </form>

                    </div>
                </div>
            </div>
        </div>
    </div>
	<script src="/assets/js/amazeui.min.js"></script>
	<script src="/assets/js/amazeui.datatables.min.js"></script>
	<script src="/assets/js/dataTables.responsive.min.js"></script>
	<script src="/assets/js/app.js"></script>
	<script src="/assets/js/zdy_form.js"></script>
	<script>
	    function back() {
	        window.history.back();
	    }
	</script>
	<script>

		fileShow("#biddingFile");
		fileShow("#bjFile");
		fileShow("#yyzzFile");
		fileShow("#otherFile");

		function fileShow(id){
			$(id).change(function (event) {
	            var filePath = $(this).val();
	            if(filePath){
	                var arr = filePath.split('\\');
	                var fileName = arr[arr.length-1];
	                $(this).parent().find(".file-show").html(fileName);
	            }else{
	                $(this).parent().find(".file-show").html("");
	                return false;
	            }
	            
	        });
		}

		var lockSubmit = false;
		$("#form_admin").submit(function(e) {
			if(lockSubmit){
                return false;
            }
            lockSubmit =true;
	        var valid = zdy.validate.valid({
	            rules:{
	                biddingFile:{required:true},
	                bjFile:{required:true},
	                contactMan:{required:true},
	                phone:{required:true,isMobile:true}
	            }, message:{
	                biddingFile:{required:"请上传投标文件"},
	                bjFile:{required:"请上传报价单"},
	                contactMan:{required:"请填写联系人"},
	                phone:{required:"请填写联系电话", isMobile:"请填写有效的11位手机号。"}
	            }   
	        });
	        if (!valid) {
	        	lockSubmit = false;
	            return false;
	        }
    });
	</script>
</body>

</html>